<div class="contents">
  <ol class="breadcrumb">
    <li><a href="#/index/panel">首页</a></li>
    <li class="active">{{vtype}}</li>
  </ol>
  <form class="form-inline search-box" role="form" ng-submit="search()" novalidate>
    <div class="form-group">
      <input type="text" class="form-control" placeholder="faID" ng-model="searchMap.id" style="width:100px;">
    </div> 
    <!--<div class="form-group">-->
      <!--<input type="text" class="form-control" placeholder="机构faID" ng-model="searchMap.uManagerId" style="width:140px;">-->
    <!--</div> -->

    <div class="form-group">
      <input type="text" class="form-control" placeholder="登录手机" ng-model="searchMap.uLoginName" style="width:140px;">
    </div> 
   
    <div class="form-group">
      <input type="text" class="form-control" placeholder="邀请人手机" ng-model="searchMap.sourceLoginName" style="width:140px;">
    </div>
    <div class="form-group">
      <input type="text" class="form-control" placeholder="公司名称" ng-model="searchMap.uCompanyName" style="width:140px;">
    </div> 
    <div class="form-group">
      <input type="text" class="form-control" placeholder="客户姓名" ng-model="searchMap.uRealName" style="width:140px;">
    </div>  

    <div class="form-group">
      <!--<input type="text" class="form-control" placeholder="注册来源活动" ng-model="searchMap.actSource" style="width:140px;">-->
      <select  class="form-control"  ng-model="searchMap.actSource"  >
        <option ng-init="searchMap.actSource = actSourceList[0]" ng-repeat="m in actSourceList" >{{m}}</option>
      </select>
    </div>
    <!--
    <div class="form-group">
      <input type="text" class="form-control" placeholder="手机号" ng-model="searchMap.uMobile">
    </div> 
    -->

    <div class="form-group">
      <select class="form-control" placeholder="是否注册" ng-model="searchMap.isRegister">
        <option value="">--是否注册--</option>
        <option value="0">否</option>
        <option value="1">是</option>
      </select>
    </div>

    <div class="form-group">
      <select class="form-control" placeholder="注册来源渠道" ng-model="searchMap.isCompany">
        <option value="">--选择注册来源渠道--</option>
        <option value="0">线上渠道</option>
        <option value="1">线下渠道</option>
      </select>
    </div>

    <div class="form-group">
      <select class="form-control" placeholder="注册来源媒体" ng-model="searchMap.mediaSource" ng-options="m.value as m.text for m in dictMap.mediaSourceModel" ><option value="">--选择注册来源媒体--</option></select>
    </div>

    <div class="form-group">
      <select class="form-control" placeholder="注册来源活动" ng-model="searchMap.actSource" ng-options="m.value as m.text for m in dictMap.actSourceModel" ><option value="">--选择注册来源活动--</option></select> 
    </div> 
    

    
    <div class="form-group">
      <select class="form-control" placeholder="是否绑定微信" ng-model="searchMap.wechatFlag" ng-options="m.value as m.text for m in dictMap.wechatFlagModel" ><option value="">--是否绑定微信--</option></select> 
    </div> 
    
    <div class="form-group">
      <select class="form-control" placeholder="认证" ng-model="searchMap.uRole" ng-options="m.value as m.text for m in dictMap.roleMapModel" ><option value="">--选择认证--</option></select> 
    </div> 
     <div class="form-group">
      <select type="text" ng-if="!config.showSystemUser" class="form-control" placeholder="服务顾问" ng-options="m.userId as m.username for m in licaishiManagerUserList" ng-model="searchMap.systemUserId" style="width:200px;"><option value="">--选择服务顾问--</option>
      </select>
       <select type="text" ng-if="config.showSystemUser" class="form-control" placeholder="服务顾问" ng-options="m.userId as m.username for m in licaishiManagerUserList" ng-model="searchMap.adviserUserId" style="width:200px;"><option value="">--选择服务顾问--</option>
      </select>
      <!-- <select type="text" class="form-control" placeholder="服务顾问" ng-options="m.userId as m.username for m in licaishiManagerUserList" ng-model="searchMap.systemUserId" style="width:200px;"><option value="">--选择服务顾问--</option> -->
      <!-- </select> -->
    </div> 
    <div class="form-group">
      <select class="form-control" ng-if="!config.showOrderFlag" ng-model="searchMap.orderFlag" placeholder="是否有过交易">
        <option value="">--是否有过交易--</option>
        <option value="1">有</option>
        <option value="0">无</option>
      </select>
    </div>
    <div class="form-group">
      <select class="form-control"  ng-model="searchMap.faRevisitType" placeholder="是否有待办">
        <option value="">--是否有待办--</option>
        <option value="1">有</option>
        <option value="2">无</option>
      </select>
    </div>
    <div class="form-group" ng-class="{'has-error':form.pBelongArea.$invalid}">
      <div class="col-sm-5">
        <select class="form-control" name="pBelongArea" ng-model="searchMap.uMobileAdd" ng-options="m.text as m.text for m in dictMap.pbelongAreaModel" required="required" placeholder="所在地区">
        <option value="">所在地区</option>
         </select> 
      </div>
    </div>
     <div class="form-group" ng-show="showVisit">
       <select class="form-control" name="customerHeat" ng-model="searchMap.customerHeat" required="required" > 
          <option value="">--选择客户热度--</option>
          <option value="1">A类客户</option>
          <option value="2">B类客户</option>
          <option value="3">C类客户</option>
          </select>
    </div> 

    <div class="form-group" ng-show="showVisit">
      <select class="form-control" ng-model="searchMap.visitModel" placeholder="未跟踪周期">
        <option value="">--请选择未跟踪周期--</option>
        <option value="3" ng-show="showVisitWhere">7-14天未跟踪</option>
        <option value="1">14-30天未跟踪</option>
        <option value="2" ng-show="!showVisitWhere">30-60天未跟踪</option>
      </select>
    </div>
    <div class="form-group">
      <select class="form-control" ng-options="m.value as m.text for m in dictMap['customerCategoryModel']" name="customerCategory "ng-model="searchMap.customerCategory" placeholder="客户分类">
        <option value="">--请选择客户分类--</option>
      </select>
    </div>
    
  <br />
    <div class="form-group">
      <select class="form-control"  name="customerCategory " ng-model="searchMap.uSystemRate" placeholder="请选择客户分类">
        <option value="">--客户分类--</option>
        <option value="OK">--OK类--</option>
        <option value="A">--A类--</option>
        <option value="B">--B类--</option>
        <option value="C">--C类--</option>
        <option value="D">--D类--</option>

      </select>
    </div>

    <div class="form-group">
      注册时间：从<input type="date" class="form-control" placeholder="注册开始日期,如2015-01-01" ng-model="searchMap.createDateStart" maxlength="10">
    </div>
    <div class="form-group">
      至<input type="date" class="form-control" placeholder="注册结束日期,如2015-01-01" ng-model="searchMap.createDateEnd" maxlength="10">
    </div>

    <div class="form-group">
      分配时间：从<input type="date" class="form-control" placeholder="分配开始日期,如2015-01-01" ng-model="searchMap.disDateStart" maxlength="10">
    </div>
    <div class="form-group">
      至<input type="date" class="form-control" placeholder="分配结束日期,如2015-01-01" ng-model="searchMap.disDateEnd" maxlength="10">
    </div>
    
  <br />
    <button type="submit" class="btn btn-primary">查询</button>

    <!-- <button type="button" class="btn btn-primary" style="margin-left:10px;" ng-click="licaishiManage(1);" has-auth where="btn" who="LICAISHI_MANAGER_USER_ADD">分配</button> -->
    <button type="button" class="btn btn-primary" style="margin-left:10px;" ng-click="licaishiManage(1);">分配</button>

    <!-- <button type="button" class="btn btn-primary" style="margin-left:10px;" ng-click="licaishiManage(0);" has-auth where="btn" who="LICAISHI_MANAGER_USER_ADD">收回</button> -->
    <button type="button" class="btn btn-primary" style="margin-left:10px;" ng-click="licaishiManage(0);">收回</button>
    
  </form>
  <table class="table table-striped table-hover">
    <thead>
      <tr>
        <th width="30"><input type="checkbox" id="chkAllLicaishiList" ng-click="chkAllLicaishiList();" /></th>
        <th width="65" ng-click="orderby('createDate')">注册时间<i class="orderby-icons" ng-class="{'orderby-asc':orderbyFreqMap['createDate'][orderbyPositionMap['createDate']] == 'asc','orderby-desc':orderbyFreqMap['createDate'][orderbyPositionMap['createDate']] == 'desc'}"></i></th>
        <th width="65" ng-click="orderby('lastLoginTime')">最后登录时间<i class="orderby-icons" ng-class="{'orderby-asc':orderbyFreqMap['lastLoginTime'][orderbyPositionMap['lastLoginTime']] == 'asc','orderby-desc':orderbyFreqMap['lastLoginTime'][orderbyPositionMap['lastLoginTime']] == 'desc'}"></i></th>
        <th width="65" ng-click="orderby('latestVisitTime')">最新回访时间<i class="orderby-icons" ng-class="{'orderby-asc':orderbyFreqMap['latestVisitTime'][orderbyPositionMap['latestVisitTime']] == 'asc','orderby-desc':orderbyFreqMap['latestVisitTime'][orderbyPositionMap['latestVisitTime']] == 'desc'}"></i></th>
        <th width="65" ng-click="orderby('addAuthDate')">提交认证时间<i class="orderby-icons" ng-class="{'orderby-asc':orderbyFreqMap['addAuthDate'][orderbyPositionMap['addAuthDate']] == 'asc','orderby-desc':orderbyFreqMap['addAuthDate'][orderbyPositionMap['addAuthDate']] == 'desc'}"></i></th>
        <!--<th width="65">faid</th>-->
        <th width="65">前服务顾问</th>
        <!--<th width="65">机构faid</th>-->
        <th width="65">是否注册</th>
        <th width="80">登录名</th>
        <th width="60">服务顾问</th>
        <th width="80">邀请人</th>
        <th width="110">客户名称</th>
        <th width="110">公司/职位</th>
		<th width="65">用户分类</th>
        <th width="70">来源</th>
        <th width="60">状态</th>
        <th width="50">操作</th>
      </tr>
    </thead>

    <tbody>
      <tr ng-repeat="fa in fas">
       <td>
          <input type="checkbox" name="chkLicaishiList" value="{{fa.id}}" omu="{{fa.systemUserId}}" />
        </td>
        <td>{{fa.createDate | date:'yyyy-MM-dd HH:mm:ss'}}</td>
        <td>{{fa.lastLoginTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
        <td>{{fa.visitStatisticVO.latestVisitTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
        <td>{{fa.addAuthDate}}</td>
		<!--<td>{{fa.id}}</td>-->
		<td>{{fa.frontLicaishiManagerUser}}</td>
        <!--<td>{{fa.uManagerId}}</td>机构faid-->
        <td>{{fa.isRegister | regiterseFilter}}</td>
        <td>
          <a href="javascript:" ng-click="toViewPage(fa.id)">{{fa.uLoginName}}</a>
          <!--
          <a ng-if="loginStatus.loginName != fa.licaishiManagerUser && loginStatus.loginName != 'admin'" href="javascript:" ng-click="toViewPage(fa.id)">{{fa.uLoginName | isEqualMyphone}}</a>
        -->

          <div class="wx-icon" title="已绑定微信" ng-if="fa.wechatFlag"></div>
          <div ng-if="fa.uMobileAdd">{{fa.uMobileAdd}}</div>
        </td>
        <td>{{fa.licaishiManagerUser}}</td>
 <!--       <td><a ng-href="{{staticHost}}{{fa.uCardAddress}}" target="_blank"><img ng-src="{{staticHost}}{{fa.uCardAddress}}" width="100" height="50" ng-show="fa.uCardAddress"/></a></td>
 -->
        <td>{{fa.sourceLoginName}}</td>
        <td>{{fa.uRealName}}</td>
        <td>{{fa.uCompanyName}}<br />{{fa.uJob}}</td>
		<td>{{fa.uSystemRate?fa.uSystemRate+'类':'未分类'}}</td>
        <td><div>{{fa.isCompany | CompanyReFilter}}</div><div>{{fa.mediaSource | mediaSourceRender}}</div><div>{{fa.actSource | actSourceRender}}</div></td>
        <td class="cert-status-{{fa.uRole}}">{{fa.status | faRoleStatusRender:fa.uRole}}</td>
        <td class="optd">
          <!--<a href="#/fa/view?id={{fa.id}}{{listWhere}}">编辑</a>-->
          <a href="javascript:" ng-click="toViewPage(fa.id)">编辑</a>
          <!--
          <a href="#/fa/edit?id={{fa.id}}">编辑</a>
          <div class="dropdown pull-right" has-auth where="btn" who="FA_BLACK_ADD">
            <button class="btn btn-sm btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">更多操作<span class="caret"></span></button>
            <ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="dropdownMenu1">
              <li role="presentation" ng-click="showBlackAddForm(fa.id)" class="cur-p" has-auth where="btn" who="FA_BLACK_ADD"><a role="menuitem" tabindex="-1">放入黑名单</a></li>
              <li role="presentation" ng-click="showCertForm(fa.id)" class="cur-p" has-auth where="btn" who="FA_UPDATE_CERT"><a role="menuitem" tabindex="-1">认证</a></li>
            </ul>
          </div>
          -->
        </td>
      </tr>
    </tbody>
  </table>

  <div style="display: inline-block" class="pager-box" ng-include src="'tpl/public/pager.html'" ng-show="fas.length > 0"></div>
  <div style="display: inline-block;vertical-align: text-bottom;margin: 15px;color: #428bca;font-size: 14px" class="form-inline" ng-show="fas.length > 0">
    <label style="vertical-align: sub;font-weight: 400">每页显示：</label><input type="number" class="form-control" ng-model="setPageSize" max="1000"><label style="vertical-align: baseline;font-weight: 400" >&nbsp;&nbsp;条（最大1000条）<button type="button" class="btn btn-primary" ng-click="changePageSize()" style="vertical-align: sub">确定</button></label>
  </div>
</div>

<div class="layer-box" ng-show="showBlackAddFormFlag">
  <div class="layer-bg"></div>
  <div class="layer-con " style="padding:10px 20px;">
    <span class="icons-close" title="关闭" ng-click="showBlackAddFormFlag = false;">X</span>
    <div class="layer-title">
      请填写加入黑名单原因
    </div>
    <div class="con-wrap">
      <form class="form-horizontal" role="form" name="form" novalidate ng-submit="blackAdd()">
        <div class="form-group" ng-class="{'has-error':form.remark.$invalid}"> 
          <textarea class="form-control" autocomplete="off" value="" name="remark" ng-model="black.remark" maxlength="100" required="required" placeholder="加入黑名单原因" style="height:100px;"></textarea>
        </div> 
        <div class="form-group" >
          <input type="submit" class="btn btn-block btn-primary" value="保存" />
        </div>
      </form>
    </div>
  </div>
</div> 

<div class="layer-box" ng-show="showCertFormFlag">
  <div class="layer-bg"></div>
  <div class="layer-con layer-big" style="padding:10px 20px;">
    <span class="icons-close" title="关闭" ng-click="showCertFormFlag = false;">X</span>
    <div class="layer-title">理财师认证</div>
    <div class="con-wrap">
      <form class="form-horizontal cert-form" role="form" name="certform" ng-submit="certSave()" novalidate>
        <div class="form-group" ng-class="{'has-error':certform.uRole.$invalid && form.uRole.$dirty}">
          <label for="advertTitleInput" class="col-sm-2 control-label">认证情况</label>
          <div class="col-sm-5">
            <select class="form-control" name="uRole" ng-model="cert.uRole" ng-options="m.value as m.text for m in dictMap['certResultModel']" required="required" ng-change="selectRoleResult(this,m.value)"> </select>
          </div>
        </div>
        <div class="form-group">
          <label for="advertTitleInput" class="col-sm-2 control-label">审核评级</label>
          <div class="col-sm-8">
            <ul class="cert-level-list"><li ng-repeat="o in dictMap['certLevelTypeModel']" ng-click="selectLevelType(o.value)" ng-class="{selected:cert.type==o.value}">{{o.text}}</li></ul>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error':certform.auditRemarks.$invalid && certform.auditRemarks.$dirty}">
          <label for="auditRemarks" class="col-sm-2 control-label">备注</label>
          <div class="col-sm-5">
            <input type="text" class="form-control" id="auditRemarks" placeholder="备注" name="auditRemarks" ng-model="cert.auditRemarks" >
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-5">
            <button type="submit" class="btn btn-default">提交</button>
          </div>
        </div>
      </form> 
    </div>
  </div>
</div> 



<div class="layer-box" ng-show="isShowLicaishiManagerLayer">
  <div class="layer-bg"></div>
  <div class="layer-con " style="padding:10px 20px;">
    <span class="icons-close" title="关闭" ng-click="isShowLicaishiManagerLayer = false;">X</span>
    <div class="layer-title">
      <label ng-if="t == '1'">分配！请确认操作！</label>
      <label ng-if="t == '0'">回收！请确认操作！</label>
    </div>
    <div class="con-wrap">
      <div class="form-group" >
        <table class="order-f-h" style="width:100%">
          <tr ng-if="t == '1'">
            <td colspan="2">
              <select class="form-control" ng-model="managerLicaishi.systemUserId" ng-options="u.userId as u.username for u in licaishiManagerUserList2">
              </select>
            </td>
          </tr>
          <tr>
            <td colspan="2" style="text-align:left;font-weight: bold;">共选择{{chooseLicaishiIdCount}}个理财师！</td>
          </tr>
          <tr>
            <td><a id="confirmButton" class="btn btn-block btn-primary" ng-click="fenpeiOrHuishou(t);">确定</a></td>
            <td><a class="btn btn-block btn-primary" ng-click="isShowLicaishiManagerLayer = false;">取消</a></td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</div> 

<div class="layer-box" ng-show="loading">
  <div class="layer-bg"></div>
  <div class="layer-con " style="padding:10px 20px;background: none; color: #fff; font-size: 28px;">
    LOADING...
  </div>
</div> 
